package com.yjzx.core.bean;

import java.util.List;
import java.util.Objects;

/**
 * @author guozhi
 * @date 2023/10/18
 * @description 数据配置
 */

public abstract class ConfigurationInfo {
    /**
     * 编码
     */
    private String encoding;

    /**
     * 项目名
     */
    private String projectName;

    /**
     * 包名
     */
    private String packageName;

    /**
     * 作者名
     */
    private String authorName;

    /**
     * 文件根目录
     */
    private String rootPath;

    /**
     * 项目根目录
     */
    private String projectPath;

    private List<TemplatePath> templatePaths;


    public final void setTemplates(List<TemplatePath> templatePaths) {
        this.templatePaths = templatePaths;
    }


    public final List<TemplatePath> getTemplates() {
        return templatePaths;
    }

    public ConfigurationInfo() {
    }

    public ConfigurationInfo(String encoding, String projectName, String packageName, String authorName, String rootPath, String projectPath, List<TemplatePath> templatePaths) {
        this.encoding = encoding;
        this.projectName = projectName;
        this.packageName = packageName;
        this.authorName = authorName;
        this.rootPath = rootPath;
        this.projectPath = projectPath;
        this.templatePaths = templatePaths;
    }

    public String getEncoding() {
        return encoding;
    }

    public void setEncoding(String encoding) {
        this.encoding = encoding;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getRootPath() {
        return rootPath;
    }

    public void setRootPath(String rootPath) {
        this.rootPath = rootPath;
    }

    public String getProjectPath() {
        return projectPath;
    }

    public void setProjectPath(String projectPath) {
        this.projectPath = projectPath;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ConfigurationInfo that = (ConfigurationInfo) o;
        return Objects.equals(encoding, that.encoding) && Objects.equals(projectName, that.projectName) && Objects.equals(packageName, that.packageName) && Objects.equals(authorName, that.authorName) && Objects.equals(rootPath, that.rootPath) && Objects.equals(projectPath, that.projectPath);
    }

    @Override
    public int hashCode() {
        return Objects.hash(encoding, projectName, packageName, authorName, rootPath, projectPath);
    }
}
